package com.aat.dxfy.spring.anno;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = { "com.aat.dxfy.spring.anno" })
public class TestApp {
	
	@Bean
	ReadService getReadService(){
		return new ReadService() {
			@Override
			public String read(String msg) {
				return "read "+msg;
			}
		};
	}

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestApp.class);
		SayView v=context.getBean(SayView.class);
		v.toView();
		context.close();
	}
}
